package com.cheejee.goodscenter.module.vo;

import com.cheejee.goodscenter.module.entity.Category;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

/**
 * @author CARRY
 * @Date 2020年10月30日下午3:17:41
 */
@Data
@Builder
@ApiModel("分类")
public class CategoryVo {

	@ApiModelProperty("父级分类ID")
    private Integer parentId;
	
	@ApiModelProperty("分类名称")
    private String name;
	
	@ApiModelProperty("分类描述")
	private String disable;
	
	@ApiModelProperty("分类图标")
    private String icon;

	@ApiModelProperty("分类跳转连接")
    private String url;

	@ApiModelProperty("分类描述")
    private String describe;
	
	public static Category convert(Integer id, CategoryVo vo) {
		return new Category(id, vo.getParentId(), vo.getName(), null, vo.getIcon(), vo.getUrl(), vo.getDescribe());
	}
}
